<div class="product-nav">
	<a href="<?php echo site_url('product');?>" class="product-back">Back to News</a>
	<?php if (!empty($prev)): ?>
		<a href="<?php echo site_url('product/'.$prev['id'].'/'.$prev['slug']) ?>" title="<?php echo htmlentities($prev['title']); ?>" class="product-prev">&lt;</a>
	<?php endif ?>
	<?php if (!empty($next)): ?>
		<a href="<?php echo site_url('product/'.$next['id'].'/'.$next['slug']) ?>" title="<?php echo htmlentities($next['title']); ?>" class="product-next">&gt;</a>	
	<?php endif ?>
</div>

<article class="product">
	<header>
		<div class="category-head"><?php echo $category['title']; ?></div>
		<h1 class="product-title"><?php echo $product['title'];?></h1>
	</header>
	<div class="box-space"></div>
	
	<?php 
	for ($i=1; $i < 7; $i++) { 
		if(empty($product['pic'.$i])){
			continue;
		}
		$figure[] = '<img src="'.config_item('asset_product').$product['pic'.$i].'" title="'.htmlentities($product['title'], ENT_COMPAT, 'UTF-8', FALSE).'" width="100%" height="450">';
	}
	
	if(!empty($figure)){
		echo '<figure>',implode('', $figure),'</figure>';
	}
	?>
	
	<h2 class="editorial">
		<?php echo $product['excerpt'];?>
	</h2>
	<div class="clear"></div>
	<div class="product-detail">
		<h3>Summary</h3>
		<?php echo $product['description'];?>
	</div>
	<aside>
		<h3>From Our Client</h3>
		<blockquote><?php echo $product['quote'];?></blockquote>
	</aside>
	<div class="clear"></div>
	<?php
	if(!empty($related_products))
	{
	?>
	<div class="related-product">
		<h4>Related Product</h4>
		<ul>
			<?php foreach($related_products as $p) { ?>
			<li>
				<div class="thumb">
					<a href="<?php echo site_url('product/'.$p['id'].'/'.$p['slug']);?>" title="<?php echo htmlentities($p['title'], ENT_QUOTES, 'utf-8') ?>">
						<img src="<?php echo config_item('asset');?>img/product/<?php echo str_replace('.', '_thumb.', $p['pic1']); ?>" width="300" height="130" alt="<?php echo htmlentities($p['title'], ENT_QUOTES, 'utf-8') ?>" />
					</a>
				</div>
				<a class="title" href="<?php echo site_url('product/'.$p['id'].'/'.$p['slug']);?>" title="<?php echo htmlentities($p['title'], ENT_QUOTES, 'utf-8') ?>">
					<?php echo $p['title'] ?>
				</a>
				<div class="category">
					<?php echo $category['title']; ?>
				</div>
				<a class="readmore" href="<?php echo site_url('product/'.$p['id'].'/'.$p['slug']);?>" title="<?php echo htmlentities($p['title'], ENT_QUOTES, 'utf-8') ?>">
					Read more
				</a>
			</li>
			<?php } ?>
		</ul>
	</div>
	<?php
	}
	?>
</article>